// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "MotionAnimInfos.h"
#include "TextInfos.h"
#include "Components/SceneComponent.h"
#include "MotionSubtitlesLayerBase.generated.h"


UCLASS()
class MOTIONSUBTITLES_API UMotionSubtitlesLayerBase : public USceneComponent
{
	GENERATED_BODY()

public:	
	UMotionSubtitlesLayerBase();
	
	void RenderOutputRT() const;
	UTextureRenderTarget2D* GetOutput() const;

	virtual void Init(const FUint32Vector2& ViewSize);

	virtual void Show(const FSubtitleParams& Params);

	virtual void ShowDeferred(const FSubtitleParams& Params);

	virtual void Hide();

	virtual void HideDeferred();

	virtual void Exit();

public:
	virtual void DoScale(const EAnimTarget AnimTarget,const int32 ElementId, const float Value);
	virtual void DoTranslate(const EAnimTarget AnimTarget, const int32 ElementId,const FVector Value);
	virtual void DoFade(const EAnimTarget AnimTarget, const int32 ElementId,const float Value);
	virtual void DoDissolve(const EAnimTarget AnimTarget, const int32 ElementId,const float Value);
	virtual void DoMarquee(const EAnimTarget AnimTarget,const EAnimDirection Direction, const int32 ElementId,const float Value);
    virtual void CaptureStatus();
	virtual int32 ElementCount();
public:
	
	UPROPERTY(EditDefaultsOnly,Category=MotionSubtitles)
	ELayerMask LayerMask;

protected:
	
	UPROPERTY(VisibleInstanceOnly,Category=MotionSubtitles)
	TObjectPtr<USceneCaptureComponent2D> SceneCaptureComponent2D;

	UPROPERTY(VisibleInstanceOnly,Category=MotionSubtitles)
	TObjectPtr<UTextureRenderTarget2D> TextureRenderTarget2D;

protected:
	FVector OriginScale;
};
